

package cn.shengchao.config;

import cn.shengchao.cap.domain.token.CapProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author <a href="https://github.com/binarywang">Binary Wang</a>
 */
@Slf4j
@Configuration
public class ThirdCapConfiguration {
    @Autowired
    private ThirdCapProperties thirdCapProperties;
   @Bean
   public CapProperties capProperties() {
       if (thirdCapProperties.getEnabled().equals("true")){
           return thirdCapProperties.getConfig();
       }else {
           return new CapProperties();
       }

    }

}